<?php
/**
 * 头部菜单
 * User: adophper <hello@adophper.com>
 * Date: 2018/3/22
 * Time: 11:47
 */
?>


<div class="footBox_top_min_middle">
    <ol class="fbox">
        <?php
        if (!empty($menu)) {
        foreach ($menu as $val) {
        if (!empty($val['url']) && $val['url'] != '/') {
            $url = Yii::$app->urlManager->createUrl([$val['url']]);
            if (!empty($val['params'])) {
                $url .= (strpos($url, '?') ? '&'.$val['params'] : '?'.$val['params']);
            }
        }else{
            $url = '/';
        }
            ?>

            <li class="fl">
                <p><?=$val['name']?></p>
                <?php if(!empty($val['child'])){
                    foreach ($val['child'] as $v){
                        if (!empty($v['url']) && $v['url'] != '/') {
                            $curl = substr($v['url'], 0, 4) == 'http' ? $v['url'] : Yii::$app->urlManager->createUrl([$v['url']]);
                            if (!empty($v['params'])) {
                                $curl .= (strpos($curl, '?') ? '&'.$v['params'] : '?'.$v['params']);
                            }
                        }else{
                            $curl = '/';
                        }
                        ?>
                    <span class="flex"><i class="iconfont">&#xe617;</i><a href="<?=$curl?>" data-code="<?=$v['code']?>"><?=$v['name']?></a></span>
                <?php }}?>
            </li>


            <?php
            }
        }
        ?>
    </ol>
</div>

